function(install name repo download)
   file(REMOVE_RECURSE ${download})

   message("----begin clone ${name}----")
   execute_process(COMMAND git clone ${repo} ${download})
   execute_process(COMMAND mkdir ${download}/build)

   message("----begin install ${name}----")
   execute_process(COMMAND cmake -DCMAKE_CXX_FLAGS=${CMAKE_CXX_FLAGS} .. WORKING_DIRECTORY ${download}/build)
   message("DESTDIR=${target_path}")
   execute_process(COMMAND make DESTDIR=${target_path} install WORKING_DIRECTORY ${download}/build)
   message("----end install ${name}----")

endfunction()
